<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: a
  Date: 2020/12/30
  Time: 9:59
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<style type="text/css">
    /*设置奇数行颜色*/
    table tr:nth-child(odd)
    {
        background: #ccc;
    }
    /*设置偶数行颜色*/
    table tr:nth-child(even)
    {
        background: #ee1414;
    }
</style>
<body>
<a href="${pageContext.request.contextPath}/peitems/getPage">查询</a>
<a href="${pageContext.request.contextPath}/peitems/insertsave">添加</a>
<a href="${pageContext.request.contextPath}/peitems/selectNotRepeat?itemname=体重">查重</a>
    <table border="1">
        <tr>
            <td>项目编号</td>
            <td>项目名称</td>
            <td>所属类型</td>
            <td>是否必填</td>
            <td>参考值</td>
            <td>价格</td>
            <td>说明</td>
            <td>操作</td>
        </tr>
        <c:forEach items="${pageUtil.lists}" var="p">
            <tr>
                <td>${p.getItemid()}</td>
                <td>${p.getItemname()}</td>
                <td>${p.getItemtype().getTypename()}</td>
                <td>${p.getNecessary()}</td>
                <td>${p.getRef()}</td>
                <td>${p.getPrice()}</td>
                <td>${p.getInfo()}</td>
                <td>
                    <a href="${pageContext.request.contextPath}/peitems/getAllById/${p.getItemid()}">修改</a>
                    <a href="${pageContext.request.contextPath}/peitems/deleteById/${p.getItemid()}">删除</a>
                </td>
            </tr>
        </c:forEach>
    </table>
<c:if test="${pageUtil.pageindex>1}">
    <a href="${pageContext.request.contextPath}/peitems/getPage?pageIndex=1">首页</a>
    <a href="${pageContext.request.contextPath}/peitems/getPage?pageIndex=${pageUtil.pageindex-1}">上一页</a>
</c:if>
当前页[${pageUtil.pageindex}/${pageUtil.pagecount}]
<c:if test="${pageUtil.pageindex<pageUtil.pagecount}">
    <a href="${pageContext.request.contextPath}/peitems/getPage?pageIndex=${pageUtil.pageindex+1}">下一页</a>
    <a href="${pageContext.request.contextPath}/peitems/getPage?pageIndex=${pageUtil.pagecount}">尾页</a>
</c:if>
</body>
</html>
